package com.example.qiaoruian.shequ.fragment;

import android.view.View;
import android.widget.GridView;

import com.example.qiaoruian.shequ.R;
import com.example.qiaoruian.shequ.bean.User;
import com.example.qiaoruian.shequ.view.BaseFragment;
import com.example.qiaoruian.shequ.view.MyTitle;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by qiaoruian on 2017/5/8.
 */

public class CommercialFragment extends BaseFragment {

    private MyTitle mTitle;
    private GridView gv;
    private int[] backgroudres = {R.drawable.tips08_03, R.drawable.tips07_03, R.drawable.tips06_03, R.drawable.tips05_03};
    private int[] res = {R.drawable.tip05_06, R.drawable.tip06_03, R.drawable.tip07_03, R.drawable.keji08_03};
    private String[] str = {"团购服务", "旅游服务", "商业活动", "科技介绍"};
    private List<User> list = null;

    @Override
    protected void initData() {

    }

    @Override
    protected void initViewData(View v) {
        mTitle = (MyTitle) v.findViewById(R.id.title);
        mTitle.getTv_title().setText("商业推广");
        mTitle.getIv_item().setVisibility(View.VISIBLE);
        mTitle.getIv_item2().setVisibility(View.GONE);
//        list = getData();
//        gv = (GridView) v.findViewById(R.id.gv);
//        gv.setAdapter(new GridViewGroupAdapter(list, getActivity()));

    }

    @Override
    protected int getLayoutId() {
        return R.layout.tuiguang_activity;
    }

    public List<User> getData() {
        List<User> l = new ArrayList<>();
        User u = null;
        for (int i = 0; i < res.length; i++) {
            u = new User(res[i],backgroudres[i] ,str[i]);
            l.add(u);
        }
        return l;
    }
}
